package com.hbzhou.open.flowcamera.util;

import ohos.app.Context;
import ohos.media.audio.AudioManager;

/**
 * author hbzhou
 * date 2019/12/13 10:49
 */
public class AudioUtil {
    /**
     * set AudioManage
     * @param context Context
     */
    public static void setAudioManage(Context context) {
        AudioManager audioManager = new AudioManager(context);

        audioManager.mute(AudioManager.AudioVolumeType.STREAM_SYSTEM);
        audioManager.mute(AudioManager.AudioVolumeType.STREAM_MUSIC);

        audioManager.setVolume(AudioManager.AudioVolumeType.STREAM_ALARM, 0);
        audioManager.setVolume(AudioManager.AudioVolumeType.STREAM_DTMF, 0);
        audioManager.setVolume(AudioManager.AudioVolumeType.STREAM_NOTIFICATION, 0);
        audioManager.setVolume(AudioManager.AudioVolumeType.STREAM_RING, 0);
    }
}
